home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / vol15n11.zip / TBWIZ.ZIP / MENULINE.CLS < prev    next >
Text File  |  1996-02-04  |  1KB  |  47 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "MenuLineClass"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Public VBInstance As Object
  11. Public MyMenuCaption As String
  12.  
  13. Public Sub AfterClick()
  14. Dim i%, j%
  15. Dim MyProperty As Object
  16. Dim testControl As Object
  17. If Not CheckForDirt() Then
  18.     Select Case Left$(MyMenuCaption, 5)
  19.     Case "&Load"    'load previously saved toolbar
  20.         Load tbLoadFrm
  21.     Case Else   'save current toolbar
  22.         Load tbSaveForm
  23.     End Select
  24. End If
  25. End Sub
  26.  
  27. Private Function CheckForDirt() As Boolean
  28. Dim CurrFormName$, i%
  29. With gobjIDEAppInst.ActiveProject
  30.     CurrFormName$ = .ActiveForm.Properties.Item("Name")
  31.     With .Components
  32.         For i% = 0 To .Count - 1
  33.             If .Item(i%).Name = CurrFormName$ Then
  34.                 If .Item(i%).IsDirty Then
  35.                     CheckForDirt = True
  36.                     Beep
  37.                     Alert "Please save " & CurrFormName$ & " before attempting to load or save a toolbar."
  38.  
  39.                   Exit Function
  40.                 End If
  41.             End If
  42.         Next
  43.     End With
  44. End With
  45.  
  46. End Function
  47.